Task : Session 1
Solve these questions own your own and try to test yourself what you have learned in the session.
Happy Learning!
Solve these questions own your own and try to test yourself what you have learned in the session.
Happy Learning!
Given strings:
"Data" "Science" "Mentorship" "Program"
"By" "CampusX"Output:
Data-Science-Mentorship-Program-started-By-CampusXConcept- [Seperator and End]
print("Data","-", "Science","-", "Mentorship","-", "Program","-", "By","-", "CampusX")
Data - Science - Mentorship - Program - By - CampusX
C=float(input("enter value of degree celsius"))
F=(9/5)*C+32
print("The value of Fahrenheit is equal",F)
enter value of degree celsius23 The value of Fahrenheit is equal 73.4
enter a :1 enter b :2 The value of a is 2 The value of b is 1
x1=int(input("enter value of x1="))
x2=int(input("enter value of x2="))
y1=int(input("enter value of y1="))
y2=int(input("enter value of y2="))
distance=((x2-x1)**2+(y2-y1)**2)**0.5
print(" eucleidian distance is equal to",distance)
enter value of x1=1 enter value of x2=2 enter value of y1=3 enter value of y2=5 eucleidian distance is equal to 2.23606797749979
Double-click (or enter) to edit
p=int(input("enter value of priciple amount="))
r=int(input("enter value of rate of interest="))
t=int(input("enter value of time period="))
SI=(p*r*t)/100
print("The simple interest value is equal to",SI)
enter value of priciple amount=50000 enter value of rate of interest=5 enter value of time period=5 The simple interest value is equal to 12500.0
For example:
Input:
heads -> 4
legs -> 12
Output:
dogs -> 2
chicken -> 2
enter value of heads=4 enter value of legs=12 number of chickens is equal to 2 number of dogs is equal to 2
n=int(input("enter value of n ="))
sum_number= n*(n+1)*(2*n+1)/6
print("The sum of squares of first n natural number is",int(sum_number))
enter value of n =5 The sum of squares of first n natural number is 55
a1=int(input("enter first term a1 ="))
a2=int(input("enter first term a2="))
n=int(input("enter value of number of terms n ="))
d=a2-a1
an=a+(n-1)*d
print("The nth term of series is equal to",int(an))
enter first term a1 =2 enter first term a2=5 enter value of number of terms n =23 The nth term of series is equal to 68
from re import S
num_1=int(input("enter first numerator value ="))
num_2=int(input("enter second numerator value ="))
deno_1=int(input("enter first denominator value ="))
deno_2=int(input("enter first denominator value ="))
summation=(num_1/deno_1)+(num_2/deno_2)
print("The sum of two fraction is equal to ",float(summation))
enter first numerator value =1 enter second numerator value =2 enter first denominator value =5 enter first denominator value =2 The sum of two fraction is equal to 1.2
Input:
Dimensions of the milk tank
H = 20cm, L = 20cm, B = 20cm
Dimensions of the glass
h = 3cm, r = 1cm
# dimension for tank
H=int(input("enter value of height(cm) ="))
L=int(input("enter value of length(cm) ="))
B=int(input("enter value of breath(cm) ="))
Vol_tank=L*B*H
print("The total volume of milk in tank(cm3)",Vol_tank)
# dimension for glass its cylinderical shape
h=int(input("enter value of height of glass(cm) ="))
r=int(input("enter value of radius of glass(cm) ="))
Vol_glass=3.14*(r**2)*h
print("The volume(cm3) of glass of milk is equal to",Vol_glass)
num_glass= Vol_tank/Vol_glass
print("the number of glass of milk is equal to",int(num_glass))
enter value of height(cm) =20 enter value of length(cm) =20 enter value of breath(cm) =20 The total volume of milk in tank(cm3) 8000 enter value of height of glass(cm) =3 enter value of radius of glass(cm) =1 The volume(cm3) of glass of milk is equal to 9.42 the number of glass of milk is equal to 849